package umg.os.process;

import java.util.ArrayList;
import java.util.InputMismatchException;
import java.util.Iterator;

public class Process implements Iterable<Operation> {

	private final ArrayList<Operation> operations;

	Process(ArrayList<Operation> operations) {
		if (operations == null) {
			throw new NullPointerException("The Operations of a Process cannot be null");
		} else if(operations.size() == 0) {
			throw new InputMismatchException("There must be at least an Operation in the Process");
		}
		this.operations = operations;
	}

	@Override
	public Iterator<Operation> iterator() {
		return operations.iterator();
	}

}
